package com.usf.jprovider.schema.selector.value;

import com.usf.jprovider.object.JObjectNode;
import com.usf.jprovider.object.env.Environment;

public final class EqualValue extends AbstractValueSelector{

	public EqualValue(){
		super();
	}
	
	@Override
	public int index(Environment env, JObjectNode node, int size) {
		return 0;
	}
	@Override
	protected int startIndex(Environment env, JObjectNode node, int size) {
		return index(env, node, size);
	}
	@Override
	protected int endIndex(Environment env, JObjectNode node, int size) {
		return index(env, node, size);
	}
	@Override
	public boolean check(Environment env, JObjectNode node, String source, String value) {
		if(ignoreCase)return source.equalsIgnoreCase(value);
		else return source.equals(value);
	}
	@Override
	public String create(Environment env, JObjectNode node, String source) {
		return source;
	}
	@Override
	public String toQuery(String column) {
		return "LIKE '" + column + "'";
	}

}
